package com.example.neteasecloudmusic_kotlin.ui.homepage

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.example.neteasecloudmusic_kotlin.logic.Repository
import com.example.neteasecloudmusic_kotlin.logic.model.HomePageEntity
import kotlin.random.Random

class DiscoveryViewModel : ViewModel() {

    private val discoveryLiveData = MutableLiveData<HomePageEntity>()

    val discoveryData = Transformations.switchMap(discoveryLiveData) { _ ->
        Repository.refreshHomePage()
    }

    fun refreshHomePage() {
        discoveryLiveData.value = HomePageEntity(null)
    }


}